#!/bin/bash

PLUGIN_DIR="/usr/lib64/oeAware-plugin"
if [ ! -d "$PLUGIN_DIR" ]; then
    mkdir -p "$PLUGIN_DIR"
fi

if [ ! -f "build/libcfgo-tuner.so" ]; then
    echo "error: no build/libcfgo-tuner.so generated"
    exit -1
fi
cp -f build/libcfgo-tuner.so $PLUGIN_DIR/
chmod 440 $PLUGIN_DIR/libcfgo-tuner.so

mkdir -p /etc/cfgo/
cp ./test/cfgo.ini /etc/cfgo/cfgo.ini
sed -i s/LOG_LEVEL\ =\ .*/LOG_LEVEL\ =\ DEBUG/ /etc/cfgo/cfgo.ini
rm -rf /etc/cfgo/*.profile
